/**
 * Created by Intellij IDEA
 *
 * @author 王俊凯
 * @Date: 2023/2/27 20:58
 * @Version 1.0
 */
package com.eight.controller;

import com.eight.pojo.TbCarTypeConfigDetails;
import com.eight.service.CarConfigService;
import com.eight.vo.CarVo;
import com.eight.vo.ComResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rent/carconfig")
public class CarConfigController {

    @Autowired
    private CarConfigService carConfigService;

    @RequestMapping("/list")
    public ComResult list(@RequestBody CarVo carVo) {
        ComResult selectAllConfig = carConfigService.selectAllConfig(carVo);
        return selectAllConfig;
    }

    @RequestMapping("/insert")
    public ComResult insert(@RequestBody TbCarTypeConfigDetails tbCarTypeConfigDetails) {
        ComResult insertConfig = carConfigService.insertConfig(tbCarTypeConfigDetails);
        return insertConfig;
    }

    @RequestMapping("/update")
    public ComResult update(@RequestBody TbCarTypeConfigDetails tbCarTypeConfigDetails) {
        ComResult updateConfig = carConfigService.updateConfig(tbCarTypeConfigDetails);
        return updateConfig;
    }

    @RequestMapping("/delete")
    public ComResult delete(int id) {
        ComResult deleteConfig = carConfigService.deleteConfig(id);
        return deleteConfig;
    }

}

